#ifndef RESOURCE_H
#define RESOURCE_H
#include <string>
#include <vector>

namespace RESOURCE
{
    class Uint_Tracer
    {
    private:
        unsigned int value;
    public:
        Uint_Tracer(unsigned int value) : value(value) {}
        unsigned int get_value() const { return value; }
        void set_value(unsigned int value) { this->value = value; }
        ~Uint_Tracer() {}
    };

    class Uint_Allocator
    {
    private:
        unsigned int start_value;
        std::vector<unsigned int> recycle;
    public:
        Uint_Allocator(unsigned int start_value) : start_value(start_value) {}
        unsigned int allocate()
        {
            if(recycle.size() > 0)
            {
                unsigned int value = recycle.front();
                recycle.erase(recycle.begin());
                return value;
            }
            return start_value++;
        }
        
        void deallocate(unsigned int value)
        {
            recycle.push_back(value);
        }
    };
}

#endif